package GdUtil;

import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;

import org.springframework.web.util.UriComponentsBuilder;

import java.net.URI;

/**
 * @Author MJS
 * @Date 2021/10/28 14:44
 * @Description
 */
public class TestGaoDe {

    public static void main(String[] args) {
        String path ="https://restapi.amap.com/v5/ip";

        MultiValueMap<String, String> params = new LinkedMultiValueMap();
        params.add("key", "388d904938aae4c2fa2dfaf666a41dd7");
        params.add("type", "4");
        params.add("ip", "220.132.43.172");

        URI url = UriComponentsBuilder.fromHttpUrl(path).queryParams(params).build().toUri();
        String s = url.toString();
        String s1 = HttpClientTest.doPostJsonOne(s);
        System.out.println(s1);
    }
}
